from abc import ABC
from typing import List

class Attribute(ABC):
    """属性基类"""
    def __init__(self, value):
        self.value = value
        self.sub_attributes : List[Attribute]= []

    def add_sub_attribute(self, sub_attribute):
        """
        添加子属性
        """
        self.sub_attributes.append(sub_attribute)

    def get_value(self):
        """
        获取当前属性值
        """
        return self.value
    
    def get_sub_attribute(self, sub_attribute):
        """
        获取子属性
        """
        for sub in self.sub_attributes:
            if isinstance(sub, sub_attribute):
                return sub
        return None
    
class DemAttribute(Attribute):
    """DEM属性"""
    
    class Elevation(Attribute):
        """高程属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Slope(Attribute):
        """坡度属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Exposure(Attribute):
        """坡向属性"""
        def __init__(self, value):
            super().__init__(value)

    class Curvature(Attribute):
        """曲率属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Roughness(Attribute):
        """地形粗糙度属性"""
        def __init__(self, value):
            super().__init__(value)

    class Relief(Attribute):
        """地形起伏度属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class ElevationCoefficientOfVariation(Attribute):
        """高程变异系数属性"""
        def __init__(self, value):
            super().__init__(value)


class Vegetation(Attribute):
    """
    植被属性
    """
    class Type(Attribute):
        """植被类型子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Density(Attribute):
        """植被密度子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class AverageHeight(Attribute):
        """平均植被高度子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class AveragePlantDiameter(Attribute):
        """平均植株胸径子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class CanopyClosure(Attribute):
        """林冠层郁闭度子属性"""
        def __init__(self, value):
            super().__init__(value)

    def __init__(self, value):
        super().__init__(value)

class Soil(Attribute):
    """
    土壤属性
    """
    class Type(Attribute):
        """土壤类型子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Hardness(Attribute):
        """土壤硬度子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class BearingCapacity(Attribute):
        """土壤承载力子属性"""
        def __init__(self, value):
            super().__init__(value)

    class SurfaceSoilThickness(Attribute):
        """表层土厚度子属性"""
        def __init__(self, value):
            super().__init__(value)

    def __init__(self, value):
        super().__init__(value)

class Water(Attribute):
    """
    水体属性
    """
    class Type(Attribute):
        """水体类型子属性"""
        def __init__(self, value):
            super().__init__(value)

    class Depth(Attribute):
        """水深子属性"""
        def __init__(self, value):
            super().__init__(value)

    class BottomGeology(Attribute):
        """水底地质子属性"""
        def __init__(self, value):
            super().__init__(value)

    class FlowSpeed(Attribute):
        """流速子属性"""
        def __init__(self, value):
            super().__init__(value)
    class Width(Attribute):
        """水体宽度子属性"""
        def __init__(self, value):
            super().__init__(value)
    class BankSteepness(Attribute):
        """岸边陡峭程度子属性"""
        def __init__(self, value):
            super().__init__(value)

class Building(Attribute):
    """
    建筑物属性
    """     
    class Type(Attribute):
        """建筑物类型子属性"""
        def __init__(self, value):
            super().__init__(value)

    class Hardness(Attribute):
        """建筑物硬度子属性"""
        def __init__(self, value):
            super().__init__(value)
    
    class Destructibility(Attribute):
        """建筑物可破坏性子属性"""
        def __init__(self, value):
            super().__init__(value)


class Geology(Attribute):
    """
    地质属性
    """

    class Type(Attribute):
        """地质类型属性"""
        def __init__(self, value):
            super().__init__(value)

    class Lithology(Attribute):
        """岩性属性"""
        def __init__(self, value):
            super().__init__(value)

    class Wrinkle(Attribute):
        """褶皱属性"""
        def __init__(self, value):
            super().__init__(value)

    class Fault(Attribute):
        """断层属性"""
        def __init__(self, value):
            super().__init__(value)






